﻿using FlitBit.Dto.ModelBinders;
using FlitBit.Wireup;

namespace FlitBit.Dto.Mvc
{
	/// <summary>
	/// Wires up the DTO-Mvc assembly's dependencies and replaces the DefaultModelBinder with an overridden version that
	/// resolves any FactoryProvider provided implementations, including DTOs.
	/// </summary>
	public sealed class AssemblyWireupReplacingDefaultModelBinder : IWireupCommand
	{
		public void Execute(IWireupCoordinator coordinator)
		{
			System.Web.Mvc.ModelBinders.Binders.DefaultBinder = new DtoEnabledDefaultModelBinder();
		}
	}
}
